<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>短信发送</title>
<link rel="stylesheet" type="text/css" href="__ADMIN__/statics/css/style.css"/>
<script src="__ADMIN__/lib/layui/layui.js" charset="utf-8"></script>
<link rel="stylesheet" href="__ADMIN__/css/font.css">

<link rel="stylesheet" href="__ADMIN__/lib/layui/css/layui.css">
</head>
<body>
<div style="height: 40px;"></div>
<div class="container">
	<div class="price">
		<h2>短信发送</h2>
		<div class="category">
			<ul>
				<li class="active">安全员</li>
				<li>执法人员</li>
				<li>自定义号码</li>
			</ul>
		</div>
		<div class="cont active">
			 <form class="layui-form" method="post" action="" enctype="multipart/form-data">
                    <div class="layui-form-item">
                        <label for="type" class="layui-form-label left_title">
                            <span class="x-red"></span>安全员：</label>
                        <div class="layui-input-inline">
                            <select id="user_company_id" name="user_company_id" class="valid">
                                <option value="">请选择安全员</option>
                                <foreach name="usercompany" item="v">
									<option value="<{$v['user_id']}>"><{$v['username']}></option>
								</foreach>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="send_content" class="layui-form-label left_title">
                            <span class="x-red">*</span>短信内容：</label>
                        <div class="layui-input-inline">
                            <textarea name="send_content" lay-verify="required" placeholder="内容" style="width: 300px;height: 100px;"></textarea>
                        </div>
                    </div>
                    
		        <div class="layui-form-item">
		            <label for="L_repass" class="layui-form-label left_title"></label>
		            <button class="layui-btn" lay-filter="add" lay-submit="">提交</button>
		        </div>
        </form>
		</div>
		<div class="cont">
			<form class="layui-form" method="post" action="" enctype="multipart/form-data">
                    <div class="layui-form-item">
                        <label for="type" class="layui-form-label left_title">
                            <span class="x-red"></span>执法人员：</label>
                        <div class="layui-input-inline">
                            <select id="user_law_id" name="user_law_id" class="valid">
                                <option value="">请选择执法人员</option>
                                <foreach name="userlaw" item="v">
									<option value="<{$v['user_id']}>"><{$v['username']}></option>
								</foreach>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="send_content" class="layui-form-label left_title">
                            <span class="x-red">*</span>短信内容：</label>
                        <div class="layui-input-inline">
                            <textarea name="send_content" lay-verify="required" placeholder="内容" style="width: 300px;height: 100px;"></textarea>
                        </div>
                    </div>
                    
		        <div class="layui-form-item">
		            <label for="L_repass" class="layui-form-label left_title"></label>
		            <button class="layui-btn" lay-filter="add" lay-submit="">提交</button>
		        </div>
        </form>
		</div>
		<div class="cont">
			<form class="layui-form" method="post" action="" enctype="multipart/form-data">
                    <div class="layui-form-item">
                        <label for="type" class="layui-form-label left_title">
                            <span class="x-red"></span>发送号码：</label>
                        <div class="layui-input-inline">
                            <input type="text" id="send_phone" name="send_phone" placeholder="发送号码" lay-verify="required" autocomplete="off" class="layui-input">                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="send_content" class="layui-form-label left_title">
                            <span class="x-red">*</span>短信内容：</label>
                        <div class="layui-input-inline">
                            <textarea name="send_content" lay-verify="required" placeholder="内容" style="width: 300px;height: 100px;"></textarea>
                        </div>
                    </div>
                    
		        <div class="layui-form-item">
		            <label for="L_repass" class="layui-form-label left_title"></label>
		            <button class="layui-btn" lay-filter="add" lay-submit="">提交</button>
		        </div>
        </form>
		</div>
		
	</div>
</div>
<script src="__ADMIN__/statics/js/jquery.min.js"></script>
<script type="text/javascript">
	$(function(){
		//选项卡切换
		$('.category ul li').click(function(){
			indexC = $(this).index();
			$(this).addClass('active').siblings().removeClass('active');
			$('.cont').eq(indexC).addClass('active').siblings().removeClass('active');
		})
		//按钮箭头
		var catew = $('.category').width()-150;
		var cateLiw = 0;
		$('.category ul li').each(function(){
			cateLiw +=$(this).outerWidth();
		})
		var i =0;
		$('.next').click(function(){
			$('.category ul').animate({
				"margin-left":-catew+'px'
			},500)
			i++;
			if((catew+150)*i+(catew+150)>=cateLiw){
				$('.prev').show();
				$('.next').hide();
			}
		})
		$('.prev').click(function(){
			$('.category ul').animate({
				"margin-left":0+'px'
			},500)
			$(this).hide();$('.next').show();
		})
	})
</script>
<script type="text/javascript" src="__COMMON__/js/jquery-2.0.3.min.js"></script>
	<script>
        layui.use('upload', function(){
    var $ = layui.jquery
        ,upload = layui.upload;
      
    
});
		layui.use(['form', 'layedit', 'laydate'], function(){
			var form = layui.form
			,layer = layui.layer
			,layedit = layui.layedit
			,laydate = layui.laydate;
			//监听提交
			form.on('submit(add)', function(data){
				$.ajax({
					url:'<{:U('Wisdom/add_send_msg')}>',
					type:"post",
					data:data.field,
					dataType:"json",
					success:function(data){
						if (data.status==1) {
							var index = parent.layer.getFrameIndex(window.name);//获取窗口索引
							//父级页面提示成功信息
							parent.layer.msg(data.info,{
									icon:1,
									time:2000
							    }, function(){
	  								parent.layer.close(index);//关闭弹出的子页面窗口
									parent.location.reload();//刷新父级页面
								});
							
						}else{
							layer.msg(data.info,{anim: 6});//错误提示
						}
					},
				});
				return false;
			});
			
		});
		
	</script>
</body>
</html>
